//
//  nigetViewController.m
//  soccer
//
//  Created by 上官千城 on 15/9/1.
//  Copyright (c) 2015年 上官千城. All rights reserved.
//

#import "OBaseViewController.h"

@interface OBaseViewController ()

@end

@implementation OBaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    //更改NAV title 字体大小和颜色
    self.navigationController.navigationBar.titleTextAttributes = @{NSFontAttributeName:[UIFont boldSystemFontOfSize:17],NSForegroundColorAttributeName:[UIColor whiteColor]};
    self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
    
    NSString *str = [[NSUserDefaults standardUserDefaults]objectForKey:@"status"];
    
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    self.navigationController.navigationBar.barTintColor = RGBACOLOR(76, 134, 143, 1);
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(changeColor:) name:@"changeToNiget" object:nil];
    
    if ([str isEqualToString:@"on"]) {
        self.view.backgroundColor = [UIColor blackColor];
        self.navigationController.navigationBar.backgroundColor = [UIColor blueColor];
        
    }

  
    
}



-(void)changeColor:(NSNotification *)notification
{
    NSString *str = (NSString *)[notification object];
    [[NSUserDefaults standardUserDefaults]setObject:str forKey:@"status"];
    
    if ([str isEqualToString:@"on"]) {
        self.view.backgroundColor = [UIColor blackColor];
        self.navigationController.navigationBar.backgroundColor = [UIColor redColor];
    }
    
    else
    {
        self.view.backgroundColor = [UIColor whiteColor];
    }
    
    
}








- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
